<!-- 快速登录 -->
<template>
  <div v-show="show==0">
    <div class="input_line input_phone clear" :class="{active:curFocus=='phone'}">
      <input class="fl" type="text" name="phoneNumber" @focus="curFocus='phone'" @blur="curFocus=''" v-model.trim="send.phoneNumber" placeholder="输入手机号">
    </div>
    <div class="input_line input_phoneAuthCode clear" :class="{active:curFocus=='AuthCode'}">
      <input class="fl" type="text" name="phoneAuthCode" @focus="curFocus='AuthCode'" @blur="curFocus=''" @keyup.enter="$emit('submit')" v-model.trim="send.phoneAuthCode" maxlength="6" placeholder="短信验证码">
      <span class="authcode fr" :class="{'gray':authStatus==1}" @click="getAuthCode">{{authStatus==0?'获取验证码':count}}</span>
    </div>
  </div>
</template>

<script>
import { fastLogin } from "../mixinsv2.1.0/fastLogin";
import { getLocal } from "../script/fn";

export default {
  mixins: [fastLogin],

  props: {
    show: {
      default: 0,
      type: Number
    }
  },
  data() {
    return {
      curFocus: "",
      send: {
        phoneNumber: getLocal("phoneNumber"),
        phoneAuthCode: ""
      },
      authStatus: 0,
      count: ""
    };
  },

  components: {},

  computed: {},

  mounted() {},
  watch: {
    "send.phoneNumber"() {
      this.disable();
    },
    "send.phoneAuthCode"() {
      this.disable();
    },
    show() {
      this.disable();
    }
  }
};
</script>
<style lang='scss' scoped>
.input_line {
  width: 279px;
  height: 40px;
  border: 1px solid #bdbdbd;
  border-radius: 4px;
  box-sizing: border-box;
  transition: all 0.3s;
  &.active {
    border: 1px solid #888888;
    input {
      color: #333333;
    }
  }
  label {
    text-align: center;
    height: 100%;
    width: 40px;
    &::after {
      content: "";
      display: inline-block;
      width: 0;
      height: 100%;
      vertical-align: middle;
    }
    .icon {
      display: inline-block;
      vertical-align: middle;
    }
  }
  input {
    box-sizing: border-box;
    font-size: 14px;
    color: #474747;
    height: 38px;
    padding-left: 9px;
    line-height: 38px;
    background: transparent;
    outline: none;
    border: none;
  }
}
.input_phone {
  margin-bottom: 20px;
  input {
    width: 100%;
  }
}
.input_phoneAuthCode {
  input {
    width: 149px;
  }
  .authcode {
    display: inline-block;
    height: 38px;
    width: 99px;
    text-align: center;
    line-height: 38px;
    border-left: 1px solid #bdbdbd;
    box-sizing: border-box;
    font-size: 14px;
    font-weight: 400;
    color: #ea2827;
    cursor: pointer;
    &.gray {
      color: #888888;
      cursor: no-drop;
    }
  }
}
</style>